package com.aaa.service.yy.impl;

import com.aaa.dao.yy.LogDao;
import com.aaa.pojo.yy.Log;
import com.aaa.service.yy.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogDao logDao;


    @Override
    public List<Log> findAllLog(String page, String limit) {
        int pageInt = Integer.parseInt(page);
        int limitInt = Integer.parseInt(limit);
        int start = (pageInt - 1)*limitInt;
        List<Log> allLog = logDao.findAllLog(start, limitInt);
        return allLog;
    }

    @Override
    public int findCount() {
        int count = logDao.findCount();
        return count;
    }

    @Override
    public int addLog(Log log) {
        int addLog = logDao.addLog();
        return addLog;
    }


}
